<script setup lang="tsx">
import Demo1 from './components/demo-1.vue'
import Demo2 from './components/demo-2.vue'

function onCb(id: number) {
  console.log({ id })
}

function render() {
  return (
    <div>
      <h1>我是tsx父组件</h1>
      <Demo1 msg="msg内容" onTest={onCb} />
      <hr />
      <Demo2
        node={(a: number) => (
          <div>
            我是node-
            {a}
          </div>
        )}
      >
        {{
          default: (a: number) => `我是default-${a}`,
          content: () => '我是content',
        }}
      </Demo2>
    </div>
  )
}
</script>

<template>
  <component :is="render()" />
</template>
